package com.itheima.Test2;

public class StringHandlerDemo {
    public static void main(String[] args) {
        useStringHandler((int age )->{
            System.out.println("我的年龄是："+age);
        });


        useStringHandler(new StringHandler() {
            @Override
            public void printMessage(int age) {
                System.out.println("只有"+age);
            }
        });
    }
    public static void useStringHandler(StringHandler s){
        s.printMessage(25);
    }
}


interface  StringHandler{
    public abstract  void printMessage(int age);
}